<?php

namespace App\Models;

class Role extends Base
{
    // 隐藏字段
    protected $hidden = ['created_at', 'updated_at'];

    /**
     * 菜单数据（多对多关系）
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function menus() {
        return $this->belongsToMany(Menu::class)->withPivot('permission')->using(MenuRole::class);
    }
}
